package com.thoughtworks.xml.service;

import com.thoughtworks.xml.model.Customer;
import com.thoughtworks.xml.repository.CustomerRepository;
import org.springframework.beans.factory.annotation.Value;

import java.util.List;

/**
 * Created by yrzhang on 10/8/16.
 */
public class CustomerServiceImpl implements CustomerService {
    private CustomerRepository customerRepository;

    private String name;
    public CustomerServiceImpl(){

    }

//    public CustomerServiceImpl(CustomerRepository customerRepository) {
//        this.customerRepository = customerRepository;
//    }

    public List<Customer> findAll() {
        return customerRepository.findAll();
    }

    public String getName() {
        return name;
    }

    public void setName(String name){
        this.name=name;
    }

    public void setCustomerRepository(CustomerRepository customerRepository) {
        this.customerRepository = customerRepository;
    }
}
